package com.zhaorujie.rpc.core.register;

import com.zhaorujie.rpc.core.spi.SpiLoader;

/**
 * @author 赵汝杰
 * @version v1.0
 * @description RegistryFactory
 * @date 2024/3/13
 **/
public class RegisterFactory {

    // SPI 动态加载
    static {
        SpiLoader.load(Register.class);
    }

    /**
     * 获取实例
     * @param key
     * @return
     */
    public static Register getInstance(String key) {
        return SpiLoader.getInstance(Register.class, key);
    }
}
